﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

             private static readonly string conString = "server=.\\SQLEXPRESS;database=Blogs;uid=sa;pwd=233333";
             private static int n;
             private static object con;
             private object textBox1;
             private object textBox2;

             public static object TextBox1 { get; private set; }

             public static DataTable GetDataTable(string sql)
             {
                SqlConnection connection = new SqlConnection(conString);

                SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);

                DataTable dt = new DataTable();

                connection.Open();
                adapter.Fill(dt);
                return dt;



                 if (n != 0)
                 {
                      MessageBox.Show("登录成功！", "提示");
                      this.Hide();
                      Form1 form1 = new Form1();
                      form1.ShowDialog();
                 }
                 else
                 {    
                      MessageBox.Show("用户名或密码错误，请重新输入！", "提示");
                 }


        }
    }
}
